<html>
<head>
<title>Validating login</title>
</head>
<body>

<?php
session_start(); 


$username=$_POST['username'];
$password=$_POST['password'];


$con = mysql_connect("localhost","root","");
 /*if (!$con)
  {
   die("Could not connect: " . mysql_error());
   }
*/

 // Create table
 mysql_select_db("checklist", $con);
 
$result = mysql_query("select * from employees where name = '".$_POST['username']."'"." and password = '".$_POST['password']."'");
   //where name = ".$_POST['username'].""

if($row = mysql_fetch_array($result))
   {
   $_SESSION['username'] = $username;
   $_SESSION['password']  = $password;
   header('Location: http://localhost/checklist/php/welcome.php');
   }
   else
   {
   $_SESSION['authentication_error'] = "Sorry , Authentication Failure";
   header('Location: http://localhost/checklist/php/login.php');
   }

 mysql_close($con);
	
?>

<!-- $row = mysql_fetch_array($result)  -->

</body>
</html>